﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 原型模式简历03
{
    public class WorkExperience
    {
        private string _workDate = string.Empty;
        private string _company  = string.Empty;

        public string workDate
        {
            set { _workDate = value;}
            get { return _workDate; }
        }

        public string company
        {
            set { _company = value;}
            get { return _company; }
        }
    }

    public class Resume : ICloneable
    {
        private string _name;
        private string _sex;
        private string _age;
        WorkExperience _workExprience;

        public Resume(string name)
        {
            _name = name;
            _workExprience = new WorkExperience();
        }

        public void SetPersonInfo(string sex,string age)
        {
            _sex = sex;
            _age = age;
        }

        public void SetWorkExperience(string workDate,string company)
        {
            _workExprience.workDate = workDate;
            _workExprience.company = company;
        }

        public void Display()
        {
            Console.WriteLine("{0} {1} {2}", _name, _sex, _age);
            Console.WriteLine("工作经历 {0} {1}", _workExprience.workDate, _workExprience.company);
            Console.WriteLine();
        }

        public Object Clone()
        {
            return (object)this.MemberwiseClone();
        }
    }
}
